package com.authine.cloudpivot.ext.enums.kingdee;

/**
 * @Author: 李国祥
 * 金蝶表单枚举
 * @Date: 2019/7/12 13:53
 * @Version 1.0
 */
public enum FormEnum {
    //客户
    CUSTOMER(1, "BD_Customer"),
    //供应商
    SUPPLIER(2, "BD_Supplier"),
    //员工
    EMPINFO(3, "BD_Empinfo"),
    //部门
    DEPARTMENT(4, "BD_Department"),
    //银行
    BANK(5, "BD_BANK "),
    //银行账号
    BANKACNT(6, "CN_BANKACNT"),

    //凭证
    VOUCHER(7,"GL_VOUCHER");

    private Integer id;
    private String text;

    FormEnum(Integer id, String text) {
        this.id = id;
        this.text = text;
    }

    public static FormEnum get(Integer code) {
        for (FormEnum c : FormEnum.values()) {
            if (c.id.toString().equals(code.toString())) {
                return c;
            }
        }
        return null;
    }

    @Override
    public String toString() {
        return text;
    }
}